package com.authine.cloudpivot.ext.enums.order;

/**
 * Created by Kris on 2019/3/25
 */
public enum MaterialEnum {
    ALL(0, "全部"),
    NEW(1, "新建"),
    DELIVERD(2, "已发货"),
    APPLY_RETURN(3, "申请退货"),
    P_AGREE_RETURN(4, "平台同意退货"),
    V_AGREE_RETURN(5, "供应商同意退货"),
    RETURNING(6, "退货中"),
    RETURNED(7, "已退货"),
    DONE(8, "已完成"),
    CLOSE(9, "关闭");

    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    MaterialEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static MaterialEnum get(Integer code) {

        for (MaterialEnum c : MaterialEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
